<template>
  <view></view>
</template>

<script>
export default {
  data() {
    return {
      isLogin: false
    }
  },
  onLoad() {
    this.checkLogin()
  },
  methods: {
    checkLogin() {
      const token = uni.getStorageSync('token')
      if (!token) {
        uni.redirectTo({
          url: '/pages/login/login'
        })
      }
      this.$emit('update:isLogin', !!token)
    }
  }
}
</script>

<style>
</style>